package org.ocean.online.wicket;

import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.markup.html.form.AjaxSubmitLink;
import org.apache.wicket.markup.html.form.Form;

public class SimpleAjaxSubmitLink extends AjaxSubmitLink{

	private static final long serialVersionUID = -3776762171503320870L;

	public SimpleAjaxSubmitLink(String id) {
		super(id);
	}

	@Override
	protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
		try {
			onSubmit(target);
		} catch (Exception e) {
			e.printStackTrace();
			target.appendJavaScript("alert('"+e.getMessage()+"')");
		}catch(Error err){
			
		}
	}

	protected void onSubmit(AjaxRequestTarget target) throws Exception{
		
	}
}
